<div class="secret_detail" style="background:#fff;padding:20px 40px 40px;">
    <div class="loader" ng-show="!item">
        <div class="loader-inner ball-clip-rotate-multiple">
            <div></div>
            <div></div>
        </div>
    </div>
    <div ng-show="item">
        <div class="panel panel-default" style="margin-bottom: 50px">
            <div class="panel-heading">
            <span class="panel-title">
                <span class="icon25 secreticon"></span>&nbsp;&nbsp;{{item.metadata.name}}
            </span>
                <a class="btn btn-gray pull-right"
                   style=" padding: 5px 10px; margin-left: 15px; height:34px; width:36px" ng-click="delete()"><i
                        class="fa fa-trash-o fa-lg"></i></a>
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-sm-4">
                        <div class="media media-sm">
                            <div class="media-left">
                                <img class="media-object" src="views/build_detail/img/images_104.png">
                            </div>
                            <div class="media-body">
                                <h4 class="media-heading">更新时间</h4>
                                <small style="color: #5a6378;"
                                       uib-tooltip="{{item.metadata.creationTimestamp | timescon}}">
                                    {{item.metadata.creationTimestamp | dateRelative}}
                                </small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <uib-tabset class="tab-default" active="active">
            <uib-tab index="1">
                <uib-tab-heading style="width: 300px; margin-left: 40px; margin-right: 40px">
                    <i class="icon20 icon20-paper"></i> 密钥信息
                </uib-tab-heading>
                <div>
                    <div class="row">
                        <div class="col-md-2 add" style="margin-bottom: 20px;">
                            <a href="javascript:;" class="href-add" style="margin-left: -13px" ng-click="addSecret()">
                                <i class="fa fa-plus-circle fa-lg"></i>&nbsp;&nbsp;<span
                                    style="font-size: 12px;">添加密钥项</span>
                            </a>

                        </div>
                        <div class="col-md-8">
                            <!--<small class="fa fa-info-circle err-tip">&nbsp;请至少保留一个密钥项</small>-->
                            <small class="fa fa-info-circle err-tip" ng-if="grid.keychongfu">&nbsp;key重复</small>
                            <small class="fa fa-info-circle err-tip" ng-if="grid.keybuhefa">&nbsp;key不合法</small>
                        </div>
                    </div>
                    <div class="row">
                        <div class="timeline col-md-12" style="margin-top: 20px;">
                            <ul style="border: none;">
                                <li ng-repeat="item in item.secretarr">
                                    <div class="container-fluid choosebar" style="margin-left: 0;">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <input style="padding-left: 5px; width: 100%;background:none;border:1px solid #c9c9c9;" type="text" ng-model="item.key"
                                                       placeholder="Key">
                                            </div>
                                            <div class="col-sm-5">

                                            </div>
                                            <div class="col-sm-3 text-right">
                                                <a class="icon25 icon25-collapse" uib-tooltip="查看内容"
                                                   ng-click="getLog($index)"
                                                   href="javascript:;"></a>

                                                <a ng-click="deletekv($index)" class="icon25 icon25-delete"
                                                   uib-tooltip="删除"
                                                   href="javascript:;"></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div uib-collapse="!item.showLog">
                                        <div class="well well-log"
                                             style='overflow: auto;background-color: #fff; margin-top: 15px;margin-left: 0;border: 1px solid #f7f8fb;'>
                                            <textarea ng-model="item.value" class="testvalue" id='sa'></textarea>
                                        </div>
                                    </div>

                                </li>
                            </ul>
                            <div class="col-md-12" style="margin-bottom: 20px;padding: 0;"
                                 ng-repeat="item in item.newarr">
                                <input class="col-md-5 key" type="text" placeholder="KEY" ng-model="item.key" style="background:none;border:1px solid #c9c9c9">
                                <div class="col-md-1"></div>
                                <textarea class="col-md-5 key" style="padding: 0px 0px 0px 10px;" type="text"
                                          placeholder="VALUE" ng-model="item.value"></textarea>

                                <a class="fa fa-times-circle col-md-1" ng-click="rmsecret($index)"
                                   style="text-decoration: none;text-align: center;line-height: 34px; color: #9fa7b7;"
                                   href="javascript:;"></a>
                            </div>
                        </div>

                    </div>
                </div>
            </uib-tab>
        </uib-tabset>
        <!--<small class="fa fa-info-circle err-tip center" style="margin-top: 50px; margin-left: 360px">&nbsp;如果密钥已经挂载在容器中，重启服务后新密钥生效</small>-->
        <!--<small class="fa fa-info-circle err-tip center" ng-if="grid.keychongfu" style="margin-top: 50px; margin-left: 360px">&nbsp;key重复</small>-->
        <!--<small class="fa fa-info-circle err-tip center" ng-if="grid.keybuhefa" style="margin-top: 50px; margin-left: 360px">&nbsp;key不合法</small>-->
        <div class="row">
            <div class="col-md-12">
                <a href="javascript:;" ng-if="grid.status" class="btn btn-block create"
                   style="background-color: #4960e6;margin: 0 auto; margin-top: 35px; color: white; width: 1000px;"
                   ng-click="updateSecret()">保存修改</a>
                <a href="javascript:;" ng-if="!grid.status" disabled="disabled" class="btn btn-block create"
                   style="background-color: #ccc;margin: 0 auto; margin-top: 35px; color: white; width: 1000px;">保存修改</a>
            </div>
        </div>
    </div>



    <style>

        .href-add:hover {
            color: #55c45f;
        }

        .testvalue {
            font-size: 12px;
            background: none;
            border: none;
            color: #55c45f;
            height: 300px;
            word-break: break-all;
            word-wrap: break-word;
            white-space: pre-wrap;
            display: block;
            max-height: 300px;
            width: 100%;
            max-width: 100%;
        }

        .key {
            height: 36px;
            line-height: 34px;
            padding: 6px 12px;
            font-size: 14px;
        }

        .choosebar:hover {
            background-color: #f7f8fb;
        }

    </style>
</div>
